package ddz;

public class Utils {
	/**
	 * int[] to String
	 * 
	 * @param a
	 * @return
	 */
	public static String ArrayIntToString(int[] a) {
		StringBuilder s = new StringBuilder();
		for (int i = 0; i < a.length - 1; i++) {
			s.append(a[i]).append("-");
		}
		s.append(a[a.length - 1]);
		return s.toString();
	}

	/**
	 * String to int[]
	 * 
	 * @param s
	 * @return
	 */
	public static int[] StringToArrayInt(String s) {
		String[] strings = s.split("-");
		int[] a = new int[strings.length];
		for (int i = 0; i < strings.length; i++) {
			a[i] = Integer.valueOf(strings[i]);
		}
		return a;
	}
	
	public static String[] getPukes() {
		String[] strings = new String[4];
		Person person = new Person();
		strings[0] = ArrayIntToString(person.getPerson1());
		strings[1] = ArrayIntToString(person.getPerson2());
		strings[2] = ArrayIntToString(person.getPerson3());
		strings[3] = ArrayIntToString(person.getThreePukes());
		return strings;
	}
}
